/**   
* @Title: SeedEnum.java
* @Package org.xaoyaoyao.spider.enums
* @Description: TODO
* @author xaoyaoyao
* @date Jan 25, 2019 1:13:53 PM
* @version V1.0   
*/
package org.xaoyaoyao.spider.enums;

/**
 * @ClassName: SeedEnum
 * @Description: TODO
 * @author xaoyaoyao
 * @date Jan 25, 2019 1:13:53 PM
 * 
 */
public enum SeedEnum {

	NORMAL(1, "正常"), NO_SEED(2, "没有种子"), IN_QUEUE(3, "在队列中"), USING(4, "处理中"), SUCCESS(5, "成功"), ERROR(500, "失败");

	private int code;

	private String remarks;

	SeedEnum(int code, String remarks) {
		this.code = code;
		this.remarks = remarks;
	}

	/**
	 * @return the code
	 */
	public int getCode() {
		return code;
	}

	/**
	 * @return remarks
	 */
	public String getRemarks() {
		return remarks;
	}

	public static ResultEnum from(int code) {
		ResultEnum[] values = ResultEnum.values();
		for (ResultEnum v : values) {
			if (code == v.getCode()) {
				return v;
			}
		}
		return null;
	}

}
